var mytips=function($){
	function build(status,info,auto,time){
		var icon='<i class="tips_icon icon_'+status+'"></i><span>'+info+'</span>';
		if($(document).find(".js_tips_box").length<=0){
			$("body").append('<div class="tips_box alert alert-'+status+' js_tips_box">'+icon+'</div>');
			var tips_width=$(".js_tips_box").width()+30;
			var tips_height=$(".js_tips_box").height()+25;
			var tips_obj=$(document).find(".js_tips_box");
			var tips_top=$(window).height()/2-tips_height/2;
			var tips_init_top=tips_top/2+(tips_top/2)/2;
			tips_obj.css({"left":$(document).width()/2-tips_width/2,"top":tips_init_top}).animate({"top":tips_top,"opacity":1},300);
		}else{
			$(document).find(".js_tips_box").html(icon).removeAttr('class').addClass('tips_box alert alert-'+status+' js_tips_box');
			var tips_width=$(".js_tips_box").width()+30;
			var tips_height=$(".js_tips_box").height()+25;
			var tips_obj=$(document).find(".js_tips_box");
			var tips_top=$(window).height()/2-tips_height/2;
			tips_obj.animate({"left":$(document).width()/2-tips_width/2,"top":tips_top,"opacity":1},300);
		}
		if(auto!=undefined && time!=undefined){
			setTimeout(function() {
				mytips.remove();
			},time)
		}
	}
	return{
		success:function(txt,auto,time){
			build('success',txt,auto,time);
			return '';
		},
		error:function(txt,auto,time){
			build('danger',txt,auto,time);
			return '';
		},
		wait:function(txt,auto,time){
			build('loading',txt,auto,time);
			return '';
		},
		tips:function(txt,auto,time){
			build('info',txt,auto,time);
			return '';
		},
		remove:function(){
			var tips_obj=$(document).find(".js_tips_box");
			var tips_height=tips_obj.height();
			var tips_top=$(window).height()/2-tips_height/2;
			tips_obj.animate({"top":tips_top/2+(tips_top/2)/2,"opacity":0},200,function(){
				tips_obj.remove();
			});
		}
	}
}(jQuery);